import 'package:flutter/material.dart';

/// 无状态布局App
class LayoutApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // 返回一个Material Design App页面
    // 标题，主题，主页
    return MaterialApp(
      title: 'Layout App',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: LayoutAppPage(),
    );
  }
}

/// 布局
class LayoutAppPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => LayoutAppPageState();
}

/// 布局状态
class LayoutAppPageState extends State<LayoutAppPage> {
  @override
  Widget build(BuildContext context) {
    // 页面
    return Scaffold(
      appBar: AppBar(
        title: Text("Layout App"),
      ),
      body: Center(
        child: MaterialButton(
          onPressed: () {},
          child: Text('Hello'),
          padding: EdgeInsets.only(left: 10.0, right: 10.0),
        ),
      ),
    );
  }
}
